#pragma once

#include "MysqlSession.h"

#include <memory>
#include <mysqlx/xdevapi.h>

class MysqlConnector
{
public:
    /**
     * @brief Construct a new Mysql Connector object
     *
     * @param conn_str user:password@host_name/db_name
     * @param pool_max_size max connection pool size
     */
    MysqlConnector(const std::string &conn_str, int pool_max_size = 8);
    ~MysqlConnector();

public:
    std::shared_ptr<MysqlSession> getSession();

private:
    std::unique_ptr<mysqlx::Client> client_;
};